package com.nd.controller.wx;


import com.nd.pojo.bo.wx.CollectAddrdleteBo;
import com.nd.pojo.vo.wx.BaseRespWXVo;
import com.nd.service.wx.CollectService;
import com.nd.pojo.bo.wx.CollectListBo;
import com.nd.pojo.vo.wx.CollectListVo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : PengFei Zhang
 * @Data :2021/6/7  11:02
 * @Description :
 */
//收藏  zpf
@RestController
@RequestMapping("wx")
public class CollectController {

    @Autowired
    CollectService collectService;

    //用户收藏的商品列表  list
    @RequestMapping("collect/list")
    public BaseRespWXVo collectList(CollectListBo collectListBo) {
        CollectListVo collectListVo = collectService.collectList(collectListBo);
        return  BaseRespWXVo.ok(collectListVo);
    }

    //商品收藏
    @RequestMapping("collect/addordelete")
    public  BaseRespWXVo collectAddrdlete(@RequestBody CollectAddrdleteBo collectAddrdleteBo) {
        //返回值为add或者delete
        String value = collectService.collectAddrdlete(collectAddrdleteBo);
        return  BaseRespWXVo.ok(value);
    }
}
